home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
PROGRAMMING
/
DESKLIBC
/
SOURCES.ZIP
/
DeskLib
/
!DLSources
/
Libraries
/
Template
/
c
/
Free
< prev
next >
Wrap
Text File
|
1992-03-31
|
2KB
|
48 lines
/*
#### # # # #
# # # # # The FreeWare C library for
# # ## ### # # # # ### RISC OS machines
# # # # # # # # # # # ___________________________________
# # #### ### ## # # # #
# # # # # # # # # # Please refer to the accompanying
#### ### #### # # ##### # ### documentation for conditions of use
________________________________________________________________________
File: Template.Free.c
Author: Copyright © 1992 Jason Williams
Thanks to John Winters for supplying the code that I hacked
changed, hacked, rewrote, and then wrote again from scratch!
Version: 1.10 (29 Mar 1992)
Purpose: Loading, cacheing, and retrieval of window templates
*/
#include "TempDefs.h"
extern void Template_Free(window_block **windowdef)
/* Deallocates the memory used by a window definition */
{
window_block *window;
icon_block *icons;
int icon;
window = *windowdef;
if (window->titleflags.data.indirected)
free(window->title.indirecttext.buffer);
icons = (icon_block *) ((int)window + sizeof(window_block));
for (icon = 0; icon < window->numicons; icon++)
{
if (icons[icon].flags.data.indirected && icons[icon].flags.data.text)
{
free(icons[icon].data.indirecttext.buffer);
if ((int) icons[icon].data.indirecttext.validstring > 0)
free(icons[icon].data.indirecttext.validstring);
}
}
free(window);
*windowdef = NULL;
}